"""
base configuration for the whole project
"""
from __future__ import annotations
from pathlib import Path
from tap import Tap
from enum import Enum


root_dir: Path = Path(__file__).parent.parent


class Distance(Enum):
    l2 = 'l2'
    cosine = 'cosine'
    dot = 'dot'


class Config(Tap):
    """train configuration"""
    bert_name: str = 'bert-base-uncased'    # pretrained model name
    do_train: bool = True                   # if do train stage
    data_dir: str = "./data/atis_snips/atis"
    train_batch_size: int = 32              # train batch size
    hidden_size: int = 100                  # hidden size of transformation feature space
    learning_rate: float = 5e-5             # learning rate of models
    n_labels: int = 21                      # the number of the target label_strings
    sentence_embedding: str = "cls"         # how to get the sentence embedding
    epsilon: float = 1e-8                   # the epsilon of the cosine method function
    max_length: int = 512                   # max sentence length
    epochs: int = 10                        # the number of epoch

    n_way: int = 5                          # the number of class of support set category
    k_shot: int = 5                         # the number of examples in every support set class
    distance: str = 'cosine'                # distance strategy`

    do_hard_sample: bool = True             # if do hard sample in every batch
